package com.example.pinyin;

import java.util.List;

import com.example.dao.TextDao;
import com.example.dao.impl.TextDaoImpl;
import com.example.model.LEARNTEXT;
import com.example.provider.LearnTextAdapter;
import com.example.utils.BaseUI;

import android.os.Bundle;
import android.widget.ListView;

public class LearnText extends BaseUI {
	
	ListView mListView;
	List<LEARNTEXT> list;
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.learntext);
		lc();
		findView();
	}

	private void findView(){
		mListView = (ListView) findViewById(R.id.lv_learntext);
	}
	
	private void useView(){
		
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		useView();
		setLearnTextAdapter(0);
		System.out.println(list+"====================================");
		
	}
	
	public void setLearnTextAdapter(int id){
		TextDao text = new TextDaoImpl();
		list= text.getListById(this, id);
		LearnTextAdapter adapter = new LearnTextAdapter(this, list);
		mListView.setAdapter(adapter);
	}
}
